package com.car.dal.dao.task;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgDuty;
import com.car.dal.object.TgState;
import com.car.dal.object.TgTask;
import com.car.util.Page;

public class TgTaskDaoImpl extends IbatisCommonDao<TgTask, Long> implements TgTaskDao {

	public GridObj GetList(TgTask task, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("desc");
		order.setSort("create_time");
		return super.findByPage(task, pageObj, order);
	}
	
	public Integer getTaskCountByType(TgTask task) {
		return this.queryForInteger("getTaskCountByType", task);
	}
	
	public List<TgTask> getTaskByType(TgTask task,Page page) {
		task.setFirstrownum(page.getFirstrownum());
		task.setPagesize(page.getPagesize());
		List<TgTask> list=this.queryForEntityList(TgTask.class,"getTaskByType", task);
		return list;
	}
	
	
	public List<TgTask> getTaskTeaCountByType(TgTask task) {
		List<TgTask> list=this.queryForEntityList(TgTask.class,"getTaskTeaCountByType", task);
		return list;
	}
	
	public List<TgTask> getTaskTeacherByType(TgTask task,Page page) {
		task.setFirstrownum(page.getFirstrownum());
		task.setPagesize(page.getPagesize());
		List<TgTask> list=this.queryForEntityList(TgTask.class,"getTaskTeacherByType", task);
		return list;
	}
	
	public List<TgTask> getTaskByType2(TgTask task) {
		List<TgTask> list=this.queryForEntityList(TgTask.class,"getTaskByType2", task);
		return list;
	}
}
